package com.blog.user.entity.vo;


import com.blog.user.entity.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserVo {
    private String userId;
    private String userName;
    private Integer userGender;
    @JsonFormat(pattern = "yyyy-MM-dd kk:mm:ss", timezone="GMT+8")
    private Date userRegisterTime;
    private Integer userFreeze;
    private String userDescription;
    private String userPet;
    private String userPhoto;
    private String userEmail;
    private  Integer role;

    public UserVo(User user){
        this.setUserId(user.getUserId());
        this.setUserEmail(user.getUserEmail());
        this.setUserDescription(user.getUserDescription());
        this.setUserName(user.getUserName());
        this.setUserPet(user.getUserPet());
        this.setUserFreeze(user.getUserFreeze());
        this.setUserPhoto(user.getUserPhoto());
        this.setUserRegisterTime(user.getUserRegisterTime());
        this.setUserGender(user.getUserGender());
    }

}
